package ca.cbc.medialib.service;

import org.dbunit.dataset.IDataSet;
import org.dbunit.dataset.xml.FlatXmlDataSetBuilder;

import java.io.InputStream;

/**
 * Created by IntelliJ IDEA.
 * User: arash
 * Date: 11-06-28
 * Time: 2:14 PM
 * To change this template use File | Settings | File Templates.
 */
public class DbUnitTestUtil {

    public static IDataSet getDataSet() throws Exception {
        InputStream is = MediaStorageServiceImplTestRead.class.getClassLoader().getResourceAsStream("dataset.xml");
        if (is == null) throw new RuntimeException("Could not find dataset.xml");
        return new FlatXmlDataSetBuilder().build(is);
    }
}
